import time

def timerun(a, b):
    if a == 60:
        a = 0
        b += 1
    return a, b

class Clock:
    def __init__(self, hour=0, minite=0, second=0):
        self.hour = hour
        self.min = minite
        self.sec = second
    def run(self):
        self.sec += 1
        self.sec, self.min = timerun(self.sec, self.min)
        self.min, self.hour = timerun(self.min, self.hour)
        if self.hour == 24:
            self.hour = 0
    def show(self):
        return f'{self.hour:0>2d}:{self.min:0>2d}:{self.sec:0>2d}'

clock = Clock(11, 11, 11)
while True:
    print(clock.show())
    time.sleep(1)
    clock.run()

'''
默写记录20241001
import time

def jinwei(a, b):
    if a == 60:
        a = 0
        b += 1
    return a, b

class Clock:

    def __init__(self, hour, minite, second):
        self.h = hour
        self.m = minite
        self.s = second
    
    def run(self):
        self.s += 1
        self.s, self.m = jinwei(self.s, self.m)
        self.m, self.h = jinwei(self.m, self.h)
        if self.h == 24:
            self.h = 0
    
    def __str__(self):
        return f'{self.h:0>2d}:{self.m:0>2d}:{self.s:0>2d}'

c = Clock(12, 34, 56)
while True:
    print(c)
    time.sleep(1)
    c.run()
'''